<!DOCTYPE html>
<html>
<head>
    <title>Font relative lengths in @viewport relative to initial font</title>
    <style>
        html { font-size: 100px; }
    </style>
</head>
<body>
    <script>
        document.body.offsetWidth; // Trigger style resolving
    </script>
    <style>
        @viewport {
            width: 10em;
            height: 10rem;
        }
    </style>
    <script>
        if (window.testRunner) {
            testRunner.injectStyleSheet("@viewport { width: extend-to-zoom 980px; min-zoom: 0.25; max-zoom: 5; height: auto; zoom: auto; user-zoom: zoom; orientation: auto }", true);
            testRunner.dumpAsText();
            document.body.offsetWidth; // Trigger style resolving
            alert(internals.viewportAsText(document, 1, 320, 352));
        }
    </script>
</body>
</html>
